package cn.highedu.spring03.entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;

// @Component
@ConditionalOnBean(Worker.class) // 说明Worker类的对象存在时 创建电锯对象
public class Saw implements Tool {
    Logger logger = LoggerFactory.getLogger(Saw.class);
    public Saw() {
        logger.info("创建电锯");
    }

    @Override
    public String toString() {
        return "电锯";
    }
}
